what is the difference between function and method